<% if @users.length == 0 then %>
  <p>Não existe nenhum usuário registrado.</p>
<% else %>
  <table border="1">
  <thead>
      <tr>
        <td>Nome</td>
        <td>E-mail</td>
        <td>&nbsp;</td>
      </tr>
  </thead>
  <tbody>
      <% for user in @users %>
      <tr onmouseover="this.style.background='#DFDFFF'" onmouseout="this.style.background=''">
        <td><%=user[:name]%></td>
        <td><%=user[:email]%></td>
        <td>
            <%=link_to_function( 
                image_tag("/images/icons/create.gif", :title => "associar", :border => "0" ) ,
                "Auth.User.add('#{user[:id]}','#{user[:name]}')" 
              ) %>
        </td>
      </tr>
      <% end %>
  </tbody>
  <tfoot>
      <tr>
          <td colspan="3" align="right">&nbsp;<%= will_paginate @users, {:action => 'group_user_list', :ajax => true} %></td>
      </tr>
  </tfoot>
  </table>
<% end %>